/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.circuitrunners.frc2011.compressor;
import edu.wpi.first.wpilibj.*;
import com.circuitrunners.frc2011.*;
/**
 * Component Module in charge of controlling the pneumatic Compressor on board the robot
 * @author Anupam and James
 */
public class CompressorFiber extends Components implements AutoCompress {
    /**
     * The compressor
     */
    private Compressor comp;
    /**
     * Main method call during tele-op execution
     */
    public void run() {
        if(comp.getPressureSwitchValue()){
            comp.stop();
        }else{
            comp.start();
        }
    }
    /**
     * Initializes the compressor module
     */
    public void init() {
        comp = new Compressor(4,10,4,1);
    }
    /**
     * Autonomous method for running the compressor
     */
    public void compress() {
        run();
    }
    /**
     * What the compressor is called to do when the robot is disabled
     */
    public void disable() {
        run();
    }

}
